@echo on

rem rd /s/q target
for /f "delims=" %%i in ('dir /s/b/ad .idea') do (
rd /s/q "%%~i"
)

pause
